{extend name="public:layout" /}
{block name="title"}店铺管理{/block}
{block name="head"}
{:widget('common/Form/icheckRes')}
{:widget('common/Form/validRes')}
<script src="/public/plugins/jsAddress/jsAddress.js"></script>
<style>
    .area_name select{width:33%;float:left;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index',['utype'=>$Request.param.utype])}"> 店铺列表</a></li>
                <li class="active">添加店铺</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">用户名</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入用户名"
                               name="username" value="" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">用户密码</label>
                    <div class="col-sm-4">
                        <input type="password" class="form-control" placeholder="请输入用户密码"
                               name="password" value="" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店主姓名</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店主姓名"
                               name="name" value="" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">所属角色</label>
                    <div class="col-sm-4">
                        <select name="group_id" class="form-control">
                            <option value="0">请选择</option>
                            {volist name="groupList" id="vo"}
                            <option value="{$vo.group_id}">{$vo.title}</option>
                            {/volist}
                        </select>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">所属行业</label>
                    <div class="col-sm-4">
                        <select name="trade_id" class="form-control">
                            <option value="0">请选择</option>
                            {volist name="tradeList" id="vo"}
                            <option value="{$vo.trade_id}">{$vo._name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">推荐店铺</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="1"> 是
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="0" checked> 否
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺状态</label>
                    <div class="col-sm-4">
                        <select name="site_status" class="form-control">
                            <option value="0">关闭</option>
                            <option value="1">开启</option>
                            <option value="2">审核中</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺名称"
                               name="site_name" value="" datatype="*" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">公司名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入公司名称"
                               name="company_name" value="" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺等级</label>
                    <div class="col-sm-4">
                        <select name="grade_id" class="form-control">
                            <option value="5">★★★★★</option>
                            <option value="4">★★★★</option>
                            <option value="3">★★★</option>
                            <option value="2">★★</option>
                            <option value="1">★</option>
                        </select>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺电话"
                               name="site_tel" value="" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">营业执照</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {:widget('common/Form/singleImg',['field'=>'site_image','',$utype])}
                        </p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺坐标</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="coordinate">
                            <span class="input-group-btn"> <button onclick="getpos()" type="button" class="btn btn-primary">定位
                                        </button> </span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺地址</label>
                    <div class="col-sm-6">
                        {:widget('common/Form/areaName')}
                    </div>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺地址"
                               name="address" value="" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">状态</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="status" value="1"> 正常
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="status" value="0" checked> 禁用
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺排序"
                               name="site_sort" value="0" datatype="n" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" onclick="ajaxSubForm();" type="submit">保存内容</button>
                        <a href="{:url('index',['utype'=>$Request.param.utype])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
    });
    function getpos() {
        layer.open({
            type: 2,
            title: '请点击后复制坐标',
            closeBtn: true, //不显示关闭按钮
            shade: [0],
            shadeClose:true,
            area: ['90vw', '90vh'],
            anim: 2,
            content: ["{:url('/plus/Bmap/getPos')}"] //iframe的url，no代表不显示滚动条
        });
    }
</script>
{/block}